home *** CD-ROM | disk | FTP | other *** search
/ Freelog 125 / Freelog_MarsAvril2015_No125.iso / Musique / Quod Libet / quodlibet-3.3.0-installer.exe / bin / quodlibet / formats / remote.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2014-12-31  |  3KB  |  64 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.7)
  3.  
  4. import os
  5. from quodlibet.formats._audio import AudioFile
  6. from quodlibet.util.path import fsnative, is_fsnative
  7. from quodlibet.util.uri import URI
  8. extensions = []
  9.  
  10. class RemoteFile(AudioFile):
  11.     is_file = False
  12.     fill_metadata = True
  13.     format = 'Remote File'
  14.     
  15.     def __init__(self, uri):
  16.         self['~uri'] = str(URI(uri))
  17.         self.sanitize(fsnative(unicode(self['~uri'])))
  18.  
  19.     
  20.     def __getitem__(self, key):
  21.         value = super(RemoteFile, self).__getitem__(key)
  22.         if key in ('~filename', '~mountpoint') and not is_fsnative(value):
  23.             if os.name == 'nt':
  24.                 value = unicode(value)
  25.             else:
  26.                 value = value.encode('utf-8')
  27.         return value
  28.  
  29.     
  30.     def rename(self, newname):
  31.         pass
  32.  
  33.     
  34.     def reload(self):
  35.         pass
  36.  
  37.     
  38.     def exists(self):
  39.         return True
  40.  
  41.     
  42.     def valid(self):
  43.         return True
  44.  
  45.     
  46.     def mounted(self):
  47.         return True
  48.  
  49.     
  50.     def write(self):
  51.         raise TypeError('RemoteFiles do not support writing!')
  52.  
  53.     
  54.     def can_change(self, k = None):
  55.         if k is None:
  56.             return []
  57.         return None
  58.  
  59.     key = property((lambda self: self['~uri']))
  60.  
  61. info = RemoteFile
  62. types = [
  63.     RemoteFile]
  64.